<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/* I use the controller class to debug
 * Author Zijian Wang
 */

class Permit extends CI_Controller {


	function show()
	{
		$f_type= $_POST['f_type'];
		$p_id = $_POST['p_id'];
		$permit = $_POST['permit'];
     
		$this->load->model('permission_model');
		$data['permit'] = $this->permission_model->create_permission($f_type, $p_id, $permit);
		
		var_dump($data);
	}

	function change()
	{
		$f_type= $_POST['f_type'];
		$p_id = $_POST['p_id'];
		$permit = $_POST['permit'];
     
		$this->load->model('permission_model');
		$data['change'] = $this->permission_model->change_permission($f_type, $p_id, $permit);
		
		var_dump($data);
	}

	function check()
	{
		$f_type= $_POST['f_type'];
		$p_id = $_POST['p_id'];
		$permit = $_POST['permit'];
     
		$this->load->model('permission_model');
		$data['check'] = $this->permission_model->check_permission($f_type, $p_id, $permit);
		
		var_dump($data);
	}
}